Skip to content

Conversation

czoido
Copy link
Contributor

@czoido czoido commented Sep 18, 2025

Hi!

While working on the whisper-cpp Conan package for ConanCenter, I noticed that enabling the with_blas option fails to build due to an issue in the MKL detection logic.

The problem is that the CMake condition currently expands BLAS_INCLUDE_DIRS without quotes:

if (${BLAS_INCLUDE_DIRS} MATCHES "mkl" AND (${GGML_BLAS_VENDOR} MATCHES "Generic" OR ${GGML_BLAS_VENDOR} MATCHES "Intel"))

When BLAS_INCLUDE_DIRS is a list (as Conan provides it), the if() command receives multiple arguments and produces a CMake error:

...
-- BLAS found, Includes: /root/.conan2/p/b/openb034c5a6ca927b/p/include;/root/.conan2/p/b/openb034c5a6ca927b/p/include/openblas
CMake Error at ggml/src/ggml-blas/CMakeLists.txt:77 (if):
  if given arguments:

    "/root/.conan2/p/b/openb034c5a6ca927b/p/include" "/root/.conan2/p/b/openb034c5a6ca927b/p/include/openblas" "MATCHES" "mkl" "AND" "(" "OpenBLAS" "MATCHES" "Generic" "OR" "OpenBLAS" "MATCHES" "Intel" ")"

  Unknown arguments specified
...

This PR fixes the issue by quoting the variable:

if ("${BLAS_INCLUDE_DIRS}" MATCHES "mkl" AND (${GGML_BLAS_VENDOR} MATCHES "Generic" OR ${GGML_BLAS_VENDOR} MATCHES "Intel"))

With this change, the whole list is treated as a single string and the regex still works correctly.

@danbev danbev merged commit 44fa2f6 into ggml-org:master Sep 19, 2025
45 of 55 checks passed
bygreencn added a commit to bygreencn/whisper.cpp that referenced this pull request Sep 24, 2025
* ggerganov/master: (92 commits)
  ggml : Fix MKL detection by quoting BLAS_INCLUDE_DIRS (ggml-org#3426)
  whisper : prefer curl over wget in download scripts (ggml-org#3409)
  ci : remove brew installation of cmake for macos-latest (ggml-org#3408)
  tests : use CMake definitions for model/sample paths (ggml-org#3406)
  Handle negative value in padding (ggml-org#3389)
  models :  update`./models/download-ggml-model.cmd` to allow for tdrz download (ggml-org#3381)
  talk-llama : sync llama.cpp
  sync : ggml
  ggml: Add initial WebGPU backend (llama/14521)
  ggml : initial zDNN backend (llama/14975)
  common : handle mxfp4 enum
  ggml-quants : fix make_qp_quants NANs and IQ1 assertion errors (llama/15379)
  vulkan: disable spirv-opt for bfloat16 shaders (llama/15352)
  vulkan: Use larger workgroups for mul_mat_vec when M is small (llama/15355)
  vulkan: support sqrt (llama/15370)
  vulkan: Optimize argsort (llama/15354)
  vulkan: fuse adds (llama/15252)
  vulkan: Support mul_mat_id with f32 accumulators (llama/15337)
  vulkan: Add missing bounds checking to scalar/coopmat1 mul_mat_id (llama/15334)
  OpenCL: add initial FA support (llama/14987)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants